<template>
  <div style="margin: 10px 10px" >
    <el-card class="box-card" style="width: 1100px">
      <template #header>
        <div class="card-header">
          <span>附件上传</span>
        </div>
      </template>
      <div  class="text item">
        <el-form :model="form" label-width="80px"  label-position="left">
          <el-form-item label="学术论文">
            <el-row span:="4">
              <p style="padding-right: 150px">论文名称</p>
              <p style="padding-right: 120px">发表杂志名称</p>
              <p style="padding-right: 140px">论文级别</p>
              <p >附件上传</p>
            </el-row>
          </el-form-item>

          <el-form-item>
            <el-col :span="5">
              <el-form-item >
                <el-input  v-model="form.paper_name" placeholder="论文名称" style="padding-right: 50px"/>
              </el-form-item>
            </el-col>
            <el-col :span="5">
              <el-form-item >
                <el-input  v-model="form.paper_magazine"  placeholder="发表杂志名称" style="padding-right: 50px"/>
              </el-form-item>
            </el-col>
            <el-col :span="5">
              <el-form-item>
                <el-select  v-model="form.region"  placeholder="论文级别" style="padding-right: 50px" >
                  <el-option label="CCF推荐A类国际学术期刊或中科院1区" value="CCF推荐A类国际学术期刊或中科院1区" />
                  <el-option label="CCF推荐B类国际学术期刊或中科院2区"
                             value="CCF推荐B类国际学术期刊或中科院2区" />
                  <el-option label="CCF推荐C类国际学术期刊或中科院3区"
                             value="CCF推荐C类国际学术期刊或中科院3区" />
                  <el-option label="一般学术期刊"
                             value="一般学术期刊" />

                </el-select>

              </el-form-item>
            </el-col>
            <el-col :span="5" >
            <el-form-item>
              <el-upload  action="/api/file/upload" :on-success="filesUploadSuccess1">
                  <el-button  :icon="Link"></el-button>
                </el-upload>
              </el-form-item>
            </el-col>
          </el-form-item>

          <el-form-item>
            <el-row >
              <el-button size="small">新增</el-button>
            </el-row>
          </el-form-item>


          <el-form-item label="学科竞赛">
            <el-row span:="4">
              <p style="padding-right: 150px">竞赛名称</p>
              <p style="padding-right: 150px">获奖级别</p>
              <p >附件上传</p>
            </el-row>
          </el-form-item>

          <el-form-item>
            <el-col :span="5">
              <el-form-item >
                <el-input  v-model="form.game_name" placeholder="竞赛名称" style="padding-right: 50px"/>
              </el-form-item>
            </el-col>
            <el-col :span="5" >
              <el-form-item >
                <el-select v-model="form.game_level" placeholder="获奖级别" style="padding-right: 50px">
                  <el-option label="国家级一等奖" value="国家级一等奖" />
                  <el-option label="国家级二等奖" value="国家级二等奖" />
                  <el-option label="国家级三等奖" value="国家级三等奖" />
                  <el-option label="省级一等奖" value="省级一等奖" />
                  <el-option label="省级二等奖" value="省级二等奖" />
                  <el-option label="省级三等奖" value="省级三等奖" />
                  <el-option label="校赛奖项" value="校赛奖项" />

                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="5" >
              <el-form-item>
            <el-upload action="/api/file/upload" :on-success="filesUploadSuccess2">
                  <el-button  :icon="Link"></el-button>
                </el-upload>
              </el-form-item>
            </el-col>


          </el-form-item>

          <el-form-item>
            <el-row >
              <el-button size="small" >新增</el-button>
            </el-row>
          </el-form-item>
        </el-form>
      </div>
      <el-button type="button.type" @click="jump" >提交</el-button>

    </el-card>

  </div>


</template>



<script>

import {reactive, ref} from 'vue'
import {Link} from "@element-plus/icons-vue";
import {ElMessage} from "element-plus";
import request from "@/utils/request";
export default {
  name: "File",
  computed: {
    Link() {
      return Link
    }
  },
  components: {},
  data(){
    return{
      form:{
        paper_name :'',
        paper_magazine : '',
        region : '',
        game_name:'',
        game_level:''

      },
      created(){
        let str = sessionStorage.getItem("student")||"{}"
        this.form = JSON.parse(str)
        this.choose()
      }
    }
/*    tableData:[]*/

    },

    methods: {
      filesUploadSuccess1(res) {
        console.log(res)
        this.form.cover = res.data
      },

      filesUploadSuccess2(res) {
        console.log(res)
        this.form.cover = res.data
      },
      jump() {
        this.$router.push("/Student")
      }

    }

}



/*import {request} from "axios";*/

/*import { useRouter } from 'vue-router';
const router = useRouter();*/
/*const { $message } = ref('');*/




/*const save = () => {
  request.post("/aaply/regulation", form1.value).then(res => {
    console.log(form1.value);
    console.log(res);
    $message({
      type: "success",
      message: "申报成功"
    });
    ElMessage.success('操作成功');
    redirectToPage();
  });
};*/


/*const redirectToPage = () => {
  router.push('/info2');
}*/


</script>



<style scoped>
card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text {
  font-size: 30px;
}

.item {
  margin-bottom: 18px;
}

.box-card {
  width: 1080px;
}
</style>